package com.cdut.domain;

public class Info {
    public final static int SUCCESS_CODE =101;
    public final static int FAIL_CODE =201;
    public final static int PASSWORD_ERROR =301;
    public final static int ERROR =901;
    public final static  int ALREADY_LOGIN = 401;
    public final static int GOODS_NUMBER_ERROR = 211;
    public final static String DEFAULT_INFO="SUCCESS";
    public final static String FAIL_INFO="fail ";
    public final static String PWD_ERROR_INFO="pasword error";
    public final static String Login_INFO="already login";
    public final static String ERROR_INFO="cant find error";
    int code;
    String info;

    public int getCode() {
        return code;
    }

    public void setCode(int errorCode) {
        this.code = errorCode;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public void success(){
        this.code = SUCCESS_CODE;
        this.info = DEFAULT_INFO;
    }

    public void fail(){
        this.code = FAIL_CODE;
        this.info = FAIL_INFO;
    }

    public void passwordError(){
        this.code = PASSWORD_ERROR;
        this.info = PWD_ERROR_INFO;
    }
    public void alreadyLogin(){
        this.code = ALREADY_LOGIN;
        this.info = Login_INFO;
    }
    public void error(){
        this.code = ERROR;
        this.info = ERROR_INFO;
    }




}
